package com.java.service.impl;

import java.util.List;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.java.dao.IDeptDAO;
import com.java.pojo.ComDept;
import com.java.pojo.ComEmp;
import com.java.service.IDeptService;

public class DeptServiceImpl implements IDeptService {

	private IDeptDAO deptdao;
	
	public IDeptDAO getDeptdao() {
		return deptdao;
	}

	public void setDeptdao(IDeptDAO deptdao) {
		this.deptdao = deptdao;
	}
	

	@Override
	public List<ComDept> getDeptListByPage(int start, int offset) {
		List<ComDept> list=deptdao.getDeptListByPage( start , offset);
		return list;
	}

	@Override
	public int getDeptNum() {
		int i=deptdao.getDeptNum();
		return i;
	}

	@Override
	public ComDept getDeptById(int id) {
		return deptdao.getDeptById(id);
	
	}

	@Override
	public String deleteDeptLog(int id) {
		String b=deptdao.deleteDept(id);
		return b;
	}


	@Override
	public String updateDeptLog(ComDept cd) {
		String b=deptdao.updateDept(cd);
		return b;
	}
   
	@Override
	public ComDept getDeptByName(String name) {
		return deptdao.getDeptByName(name);
	}

	@Override
	public ComEmp getEmpByName(String name) {
		
		return deptdao.getEmpByName(name);
	}

	@Override
	public List<ComDept> getDeptByEmp(String manager) {
		return deptdao.getDeptByEmp(manager);
	}

	@Override
	public String addDeptLog(ComDept cd, String manager) {
		
		return deptdao.addDept(cd, manager);
	}

	@Override
	public List<ComEmp> getAllEmpInDept() {
		
		return deptdao.getAllEmpin();
	}

	@Override
	public List<ComDept> getAllDept() {
		
		return deptdao.getAllDept();
	}

	@Override
	public ComEmp getEmpById(int eid) {
		
		return deptdao.getEmpById(eid);
	}


}
